/**    
 * @{#} RoleServiceImpl4MyBatis.java Create on 2012-6-8 上午12:13:27    
 *    
 * Copyright (c) 2012 by 悠忧虫.    
 *    
 * @author 悠忧虫
 * @version 1.0    
 */
package tk.sunlatus.project.permission.service.impl;

import java.util.List;

import tk.sunlatus.project.permission.dao.RoleDao;
import tk.sunlatus.project.permission.domain.Role;
import tk.sunlatus.project.permission.service.RoleService;

/**
 * @{# RoleServiceImpl4MyBatis.java Create on 2012-6-8 上午12:13:27
 * 
 *     类功能说明:
 * 
 *     <p>
 *     Copyright: Copyright(c) 2012
 *     </p>
 * @Version 1.0
 * @Author 悠忧虫
 */
public class RoleServiceImpl4MyBatis implements RoleService {

    private RoleDao roleDao = null;

    @Override
    public Role addRole(Role role) {
        return roleDao.saveRole(role);
    }

    @Override
    public Role modifyRole(Role role) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public int deleteRoles(Role role) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public Role deleteRoleByID(String roleID) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Role queryByID(String roleID) {
        // TODO Auto-generated method stub
        return roleDao.queryByID(roleID);
    }

    @Override
    public List<Role> queryRoles(Role role) {
        return roleDao.queryRoles(role);
    }
    
    @Override
    public void addUsers2Role(Role role, String[] roleUserIDs) {
        roleDao.addUsers2Role(role, roleUserIDs);
    }

    /**
     * @return the roleDao
     */
    public RoleDao getRoleDao() {
        return roleDao;
    }

    /**
     * @param roleDao
     *            the roleDao to set
     */
    public void setRoleDao(RoleDao roleDao) {
        this.roleDao = roleDao;
    }


}
